{extend name="base" /}
{block name="content"}
<div class="content">
    <div class="container-fluid">
        <!-- Page-Title -->
        <div class="row">
            <div class="col-12">
                <div class="page-title-box">
                    <div class="page-title-right">
                        <ol class="breadcrumb m-0">
                            <li class="breadcrumb-item"><a href="{:url('index/index')}"><i class="fe-home"></i> 控制台</a></li>
                            <li class="breadcrumb-item active">About us</li>
                        </ol>
                    </div>
                    <h4 class="page-title">
                        <i class="fe-file-text"></i> About us 
                    </h4>
                </div>
            </div>
        </div>
        <div class="row">
        <div class="col-lg-12 col-md-12">
            <div class="card-box">
                    <form id="form1">
                    <input type="hidden" name="id" value="{$detail['id']}">
                    <p>快速编辑信息</p>
                    <br/>
                    <div class="form-group row">
                        <label for="user" class="col-1 col-form-label">标题</label>
                        <div class="col-5">
                            <input type="text" class="form-control" id="title" value="{$detail.title}" placeholder="资讯标题" name="title">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="user" class="col-1 col-form-label">小标题</label>
                        <div class="col-5">
                            <input type="text" class="form-control" id="title_sub" value="{$detail.title_sub}" placeholder="资讯标题" name="title_sub">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="user" class="col-1 col-form-label">详细</label>
                        <div class="col-10">
                            <textarea class="keditor" name="content" id="content" rows="5" placeholder="详细" style="min-height: 250px">{$detail.content}</textarea>
                            <span class="err"  id="err_content"></span>
                        </div>
                    </div>
                   
                    <div class="form-group mb-3 justify-content-end row">
                        <div class="col-9">
                             <a class="btn btn-info waves-effect waves-light" style="color: #fff" onclick="postBtn()" >更新</a>
                        </div>
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div> <!-- container -->
</div> <!-- content -->
<script type="text/javascript" src="/static/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="/static/ueditor/ueditor.all.js"></script>
<script type="text/javascript" src="/static/ueditor/lang/zh-cn/zh-cn.js"></script>
<script src="/static/layui/layui.js"></script>
<script type="text/javascript">
    window.onload = function(){
      var ue = UE.getEditor('content');
     }   

    layui.use(['element', 'form', 'layedit','upload'], function () {
        var form = layui.form;
        var $ = layui.jquery,upload = layui.upload;
    }) 
</script>
<script type="text/javascript">
    function postBtn(e){
        var data = $('#form1').serialize();
        $.post('/admin/system/about', data, function(res){
            if(res.code == 0){
                layer.msg(res.message,{icon:1, time:1000, shade: [0.2, '#000']});
            }else{
                layer.msg(res.message,{icon:5, anim: 6, time:1000, shade: [0.2, '#000']});
            }
        },'json');
    }
</script>
{/block}